package com.example.backgroundmanger.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

/**
 * <p>
 * 
 * </p>
 *
 * @author 坤哥
 * @since 2024-07-01
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("sys_user")
@Schema(name = "User", description = "用户实体类")
@ContentRowHeight(18)//内容行高
@HeadRowHeight(25)//标题行高
@ColumnWidth(20)///列宽，可设置成员变量(属性)上
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

      @Schema(description = "用户ID")
      @TableId(value = "id", type = IdType.AUTO)
      @ExcelProperty(value = "用户ID",index = 0) //导出的数据 index:导出excel表的列的下标
      private Integer id;

      @Schema(description = "名称")
      @ExcelProperty(value = "名称",index = 1)
      private String username;

      @Schema(description = "密码")
      @ExcelProperty(value = "密码",index = 2)
      private String password;

      @Schema(description = "邮箱")
      @ExcelProperty(value = "邮箱",index = 3)
      private String email;

      @Schema(description = "电话")
      @ExcelProperty(value = "电话",index = 4)
      private String phone;

      @Schema(description = "状态")
      @ExcelProperty(value = "状态",index = 5)
      private Boolean status;

      @Schema(description = "头像")
      @ExcelIgnore //忽略导出的属性
      private String avatar;

      @Schema(description = "是否被删除")
      @ExcelIgnore //忽略导出的属性
      private Integer deleted;

      @Schema(description = "角色")
      @ExcelProperty(value = "角色",index = 6)
      private String role;

      @Schema(description = "创建删除")
      @ExcelProperty(value = "创建时间",index = 7)
      private LocalDateTime createTime;
}
